<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="dictGroupList" checkbox="false" fitColumns="true" title="实验室权限设置" actionUrl="labOpenController.do?rightdatagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="100"></t:dgCol>
   <t:dgCol title="实验室编号"  field="no"   query="true" queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="实验室名称"  field="name"   query="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="详细地址"  field="address"   query="false" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="所属院系"  field="college.collegeName"  replace="${collegeList}"  query="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="管理员"  field="teacher.realName"   query="false" queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="分室数"  field="branchCount"   query="false" queryMode="single"  width="40"></t:dgCol>
   <t:dgCol title="座位数"  field="seatCount"   query="false" queryMode="single"  width="40"></t:dgCol>
   <t:dgCol title="开放状态"  field="state"   query="false" queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="设备类型" field="opt" width="120"></t:dgCol>
   <t:dgFunOpt title="电源" funname="toPowerConfig(id)" />
   <t:dgFunOpt title="门禁" funname="toDoorConfig(id)" />
   <t:dgFunOpt title="监控" funname="toOpenConfig(id)" />
   </t:datagrid>
  </div>
 </div>
 <script type="text/javascript">
 $(document).ready(function(){
 		//给时间控件加上样式
 		$("#dictGroupListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
 
 function toPowerConfig(id){
		 
	  var addurl = 'labOpenController.do?showPowerConfigView&labId='+id;
	 
	  $.dialog({
		  	id:'showPowerConfigView',
			content: 'url:'+addurl,
			lock : true,
			zIndex: 1000, 
			width:370,
			height:150,
			title:'电源权限 ', 
			opacity : 0.3,
			cache:false,
		    cancelVal: '关闭',
		    cancel: true,
		    ok: function(){
		    	return true;
// 		    	iframe = this.iframe.contentWindow;
// 		    	var message = iframe.saveForm();
// 		    	if(message != null && message == 'true') {
// 		    		window.location.href="labAppointApplyController.do?list";
// 		    		return true;
// 		    	}else{
// 		    		return false;
// 		    	}
		    },
		});
	 
 }
 
 function toDoorConfig(id){
	 
	  var addurl = 'labOpenController.do?showDoorConfigView&labId='+id;
	 
	  $.dialog({
		  	id:'showDoorConfigView',
			content: 'url:'+addurl,
			lock : true,
			zIndex: 1000, 
			width:370,
			height:150,
			title:'门禁权限 ', 
			opacity : 0.3,
			cache:false,
		    cancelVal: '关闭',
		    cancel: true,
		    ok: function(){
		    	return true;
//		    	iframe = this.iframe.contentWindow;
//		    	var message = iframe.saveForm();
//		    	if(message != null && message == 'true') {
//		    		window.location.href="labAppointApplyController.do?list";
//		    		return true;
//		    	}else{
//		    		return false;
//		    	}
		    },
		});
	 
}
 
 </script>